home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC))))
-
-
-
- NNNNAAAAMMMMEEEE
- getpwent, getpwent_r, getpwuid, getpwuid_r, getpwnam, getpwnam_r,
- setpwent, endpwent, fgetpwent, fgetpwent_r - get password file entry
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ppppwwwwdddd....hhhh>>>>
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ggggeeeettttppppwwwweeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ggggeeeettttppppwwwweeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ppppwwwweeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, ssssiiiizzzzeeee____tttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ggggeeeettttppppwwwwuuuuiiiidddd((((uuuuiiiidddd____tttt uuuuiiiidddd))));;;;
-
- iiiinnnntttt ggggeeeettttppppwwwwuuuuiiiidddd____rrrr((((uuuuiiiidddd____tttt uuuuiiiidddd,,,, ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ppppwwwweeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, ssssiiiizzzzeeee____tttt bbbbuuuuffffssssiiiizzzzeeee,,,, ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ********rrrreeeessssuuuulllltttt))));;;;
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ggggeeeettttppppwwwwnnnnaaaammmm((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
-
- iiiinnnntttt ggggeeeettttppppwwwwnnnnaaaammmm____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ppppwwwweeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, ssssiiiizzzzeeee____tttt bbbbuuuuffffssssiiiizzzzeeee,,,, ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ********rrrreeeessssuuuulllltttt))));;;;
-
- vvvvooooiiiidddd sssseeeettttppppwwwweeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- vvvvooooiiiidddd eeeennnnddddppppwwwweeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ffffggggeeeettttppppwwwweeeennnntttt((((FFFFIIIILLLLEEEE ****ffff))));;;;
-
- ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ffffggggeeeettttppppwwwweeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****ffff,,,, ssssttttrrrruuuucccctttt ppppaaaasssssssswwwwdddd ****ppppwwwweeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, ssssiiiizzzzeeee____tttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt ____ggggeeeettttppppwwwweeeennnntttt____nnnnoooo____yyyypppp;;;;
-
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt ____ggggeeeettttppppwwwweeeennnntttt____nnnnoooo____sssshhhhaaaaddddoooowwww;;;;
-
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt ____ppppwwww____ssssttttaaaayyyyooooppppeeeennnn;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _g_e_t_p_w_e_n_t, _g_e_t_p_w_u_i_d , _g_e_t_p_w_n_a_m and their reentrant counterparts each
- return a pointer to an object with the following structure containing the
- broken-out fields of a line in the /_e_t_c/_p_a_s_s_w_d file or some other back-
- end database. Each line in the file contains a ``passwd'' structure,
- declared in the <_p_w_d._h> header file:
-
- struct passwd {
- char *pw_name;
- char *pw_passwd;
- uid_t pw_uid;
- gid_t pw_gid;
- char *pw_age;
- char *pw_comment;
- char *pw_gecos;
- char *pw_dir;
- char *pw_shell;
- };
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC))))
-
-
-
- This structure is declared in <_p_w_d._h> so it is not necessary to redeclare
- it.
-
- The fields have meanings described in _p_a_s_s_w_d(4).
-
- _g_e_t_p_w_e_n_t when first called returns a pointer to the first passwd
- structure in the file; thereafter, it returns a pointer to the next
- passwd structure in the file; so successive calls can be used to search
- the entire file. _g_e_t_p_w_u_i_d searches from the beginning of the file until
- a numerical user id matching _u_i_d is found and returns a pointer to the
- particular structure in which it was found. _g_e_t_p_w_n_a_m searches from the
- beginning of the file until a login name matching _n_a_m_e is found, and
- returns a pointer to the particular structure in which it was found. If
- an end-of-file or an error is encountered on reading, these functions
- return a NULL pointer.
-
- The _g_e_t_p_w_n_a_m__r and _g_e_t_p_w_u_i_d__r calls are reentrant versions of the
- _g_e_t_p_w_n_a_m and _g_e_t_p_w_u_i_d calls. The extra arguments are pwent, buffer are
- used for internal storage, bufsize is the size of buffer, and result is
- the struct passwd used to return the requested information. A good
- size of buffer is BUFSIZ bytes.
-
- A call to _s_e_t_p_w_e_n_t has the effect of rewinding the password file to allow
- repeated searches. _e_n_d_p_w_e_n_t may be called to close the password file
- when processing is complete.
-
- _f_g_e_t_p_w_e_n_t returns a pointer to the next passwd structure in the stream _f,
- which matches the format of /_e_t_c/_p_a_s_s_w_d.
-
- The routines getpwent, fgetpwent, getpwnam and getpwuid all return data
- from a statically allocated space which is overwritten on each call.
- Reentrant versions of these routines getpwent_r, fgetpwent_r, getpwnam_r,
- and getpwuid_r are provided which will parse the result into supplied
- space. Each takes three extra arguments, a pointer to a struct passwd
- structure, a pointer to a character buffer, and a length for the buffer.
-
- NNNNOOOOTTTTEEEESSSS
- In IRIX 4.0, there were two versions of the getpwent primitives: the
- standard version in _llll_iiii_bbbb_cccc and the NIS version in _llll_iiii_bbbb_ssss_uuuu_nnnn. The routines in
- this release only parse files in the format given in passwd(4). Either
- the static file /_e_t_c/_p_a_s_s_w_d or a dynamic file supplied by the nsd(1M)
- daemon. The nsd daemon can supply data from any number of back-end
- databases or protocols as controlled by the nsd configuration file
- /_e_t_c/_n_s_s_w_i_t_c_h._c_o_n_f. To force these routines to use only the static file
- set the external variable __g_e_t_p_w_e_n_t__n_o__y_p to 1. This is only really
- useful for programs that will use this information in subsequent
- _p_u_t_p_w_e_n_t(3C) calls (otherwise, the entire back-end database will be
- copied to /_e_t_c/_p_a_s_s_w_d). __g_e_t_p_w_e_n_t__n_o__y_p is understood by _g_e_t_p_w_e_n_t,
- _g_e_t_p_w_n_a_m, _g_e_t_p_w_u_i_d and their reentrant counterparts.
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC)))) GGGGEEEETTTTPPPPWWWWEEEENNNNTTTT((((3333CCCC))))
-
-
-
- For _g_e_t_p_w_n_a_m and _g_e_t_p_w_u_i_d only, if the file /_e_t_c/_s_h_a_d_o_w is present, and
- the current effective user ID is root, the password entry will be copied
- out of /_e_t_c/_s_h_a_d_o_w and placed in the _p_w__p_a_s_s_w_d field. This compatibility
- feature permits programs expecting password information to be in
- /_e_t_c/_p_a_s_s_w_d to function properly in a shadow password environment. Note
- that the aging information from /_e_t_c/_s_h_a_d_o_w is not made available in
- _p_w__a_g_e. For portability to other systems, the existence of /_e_t_c/_s_h_a_d_o_w
- should be dealt with by the program, not this interface (see
- _g_e_t_s_p_e_n_t(3C)). To disable this behavior (for example, to make a verbatim
- copy of /_e_t_c/_p_a_s_s_w_d using _p_u_t_p_w_e_n_t(3C)), set the external variable
- __g_e_t_p_w_e_n_t__n_o__s_h_a_d_o_w to 1.
-
- To cause the password file to be left open until an explicit call to
- _e_n_d_p_w_e_n_t(3C), set the external variable __p_w__s_t_a_y_o_p_e_n to 1.
-
- By default, __g_e_t_p_w_e_n_t__n_o__y_p, __g_e_t_p_w_e_n_t__n_o__s_h_a_d_o_w, and __p_w__s_t_a_y_o_p_e_n are 0.
-
- The Mips ABI specifies nothing but local files so applications which wish
- to use anything else must compile with libc prior to libnsl in the
- library list.
-
- When nsd is running changes to the local passwd file may not be noticed
- by getpwent() until the enumeration cache file has timed out.
-
- FFFFIIIILLLLEEEESSSS
- /etc/passwd /var/ns/cache/passwd.byname.m /var/ns/cache/passwd.byuid.m
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- nsd(1M), getlogin(3C), getgrent(3C), getspent(3C), passwd(4), shadow(4)
- fopen(3S).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- A NNNNUUUULLLLLLLL pointer is returned on EEEEOOOOFFFF or error.
-
- BBBBUUUUGGGGSSSS
- All of the functions use _f_o_p_e_n(3S) and are thus subject to its
- limitations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-